package com.taxi.driver.module.vo;

import com.alibaba.fastjson.JSON;
import com.taxi.driver.R;
import com.taxi.driver.config.TypeTripNew;
import com.taxi.driver.data.entity.OrderSummaryEntity;

/**
 * 功能描述：
 */
public class OrderSummaryVO {

    public static OrderSummaryVO createFrom(OrderSummaryEntity entity) {
        if (entity == null) return new OrderSummaryVO();
        String strJson = JSON.toJSONString(entity);
        return JSON.parseObject(strJson, OrderSummaryVO.class);
    }

    public String uuid;
    public String originAddress;
    public String destAddress;
    public Integer typeTime;
    public Integer typeTrip;
    public Double totalFare;
    public Long deparTime;
    public Integer actualPasNum;
    public Integer subStatus;
    public Integer mainStatus;
    public Double planTrip;

    // 订单模块类型（1：出租车，2：专车，3：拼车，4：快车，5：货的，6：骑手，7：搬家）
    public Integer typeModule;
    // 订单行程类型（1：用车，2：日租，3：半日租，4：送机，5：接机）
    public int typeTripNew;
    // 订单时效类型（1：实时，2：预约）
    public int typeTimeNew;

    public String getDestAddress() {
        return destAddress;
    }

    public String getOriginAddress() {
        return originAddress;
    }

    public long getDepartTime() {
        return deparTime == null ? 0L : deparTime;
    }

    public Integer getTypeTime() {
        return typeTime == null ? 0 : typeTime;
    }

    public Double getPlanTrip() {
        return planTrip == null ? 0D : planTrip;
    }

    public static int tripType(Integer typeTripNew, Integer typeTimeNew) {
        switch (typeTripNew) {
            case TypeTripNew.USE_CAR:
                if (typeTimeNew == 1) {
                    return R.string.tag_rightnow;
                } else {
                    return R.string.tag_appintment;
                }
            case TypeTripNew.DAILY_RENT:
                return R.string.tag_daily_rent;
            case TypeTripNew.HALF_DAY_RENT:
                return R.string.tag_half_day_rent;
            case TypeTripNew.AIRPORT_DROP_OFF:
                return R.string.tag_airport_drop_off;
            case TypeTripNew.AIRPORT_PICKUP:
                return R.string.tag_airport_pickup;
            default:
                return 0;
        }
    }
}
